---
# License: MIT

# Author Information
# Larry Smith Jr.
# http://everythingshouldbevirtual.com
# https://www.twitter.com/mrlesmithjr
# mrlesmithjr@gmail.com

# To view available options and settings reference the environment.yml in
# Test/dummy/server/environment.yml
provisioners: {{ environment['provisioners'] }}
{%- if environment['synced_folders'] is not none %}
synced_folders: {{ environment['synced_folders'] }}
{%- else %}
synced_folders: []
{%- endif %}

{%- if environment['nodes'] != [] %}
nodes:
{%-   for node in environment['nodes'] %}
  - name: {{ node['name'] }}
{%-     if node['ansible_groups'] != [] %}
    ansible_groups:
{%-       for group in node['ansible_groups'] %}
      - {{ group }}
{%-       endfor -%}
{%      else %}
    ansible_groups: []
{%      endif %}
    box: {{ node['box'] }}
    desktop: {{ node['desktop']|lower }}
{%-     if node['disable_synced_folders'] is not none %}
    disable_synced_folders: {{ node['disable_synced_folders']|lower }}
{%-     endif %}
    disks: {{ node['disks'] }}
{%-     if node['interfaces'] != [] %}
    interfaces:
{%-       for interface in node['interfaces'] %}
      - ip: {{ interface['ip'] }}
        auto_config: {{ interface['auto_config']|lower }}
        method: {{ interface['method'] }}
{%-         if interface['network_name'] is defined %}
        network_name: {{ interface['network_name'] }}
{%-         endif %}
{%-       endfor -%}
{%      else %}
    interfaces: []
{%-     endif %}
    linked_clone: {{ node['linked_clone']|lower }}
{%-     if node['manage_hostname'] is not none %}
    manage_hostname: {{ node['manage_hostname']|lower }}
{%-     endif %}
    mem: {{ node['mem'] }}
    provision: {{ node['provision']|lower }}
    provisioners: {{ node['provisioners'] }}
{%-      if node['synced_folder'] is not none %}
    synced_folder:
      type: {{ node['synced_folder']['type'] }}
{%-      endif %}
    vcpu: {{ node['vcpu'] }}
    port_forwards: {{ node['port_forwards'] }}
    windows: {{ node['windows']|lower }}
{%   endfor -%}
{% else %}
nodes: []
{% endif %}